package nc.bs.pub.action;

import nc.bs.common.projectFAUtils;
import nc.bs.framework.common.NCLocator;
import nc.bs.pub.compiler.AbstractCompiler2;
import nc.itf.pu.m20.IPraybillRevise;
import nc.vo.pu.m20.entity.PraybillVO;
import nc.vo.pub.BusinessException;
import nc.vo.pub.compiler.PfParameterVO;
import nc.vo.uap.pf.PFBusinessException;

public class N_20_REVISEDELETE extends AbstractCompiler2 {
	public String getCodeRemark() {
		return "  //####本脚本必须含有返回值,返回DLG和PNL的组件不允许有返回值####\n  Object retObj=null;\nnc.vo.pu.m20.entity.PraybillVO[] inObject = (nc.vo.pu.m20.entity.PraybillVO[]) getVos();\n          Object retValue =nc.bs.framework.common.NCLocator.getInstance().lookup(nc.itf.pu.m20.IPraybillApprove.class).unApprove(inObject,this);\n          return retValue;\n";
	}

	public Object runComClass(PfParameterVO vo) throws BusinessException {
		try {
			super.m_tmpVo = vo;
			PraybillVO[] inObject = (PraybillVO[]) ((PraybillVO[]) this.getVos());
			
			//lhw 231211 删除前校验项目 begin
			new projectFAUtils().projectDataApprove("po_praybill", inObject, "delete");
			//end
			
			Object retValue = ((IPraybillRevise) NCLocator.getInstance().lookup(IPraybillRevise.class))
					.reviseDelete(inObject, this);
			return retValue;
		} catch (Exception var4) {
			if (var4 instanceof BusinessException) {
				throw (BusinessException) var4;
			} else {
				throw new PFBusinessException(var4.getMessage(), var4);
			}
		}
	}
}